<?php
//session 比较常用的是存放用户的登录状态
session_start();
if(count($_POST)){
if($_POST["username"]=="zhanghui"&&$_POST["pwd"]=="123456"){
$_SESSION["uid"]=123;
}else{
echo "<br/>用户名或者密码错误!<br/>";
}
}
?>


<html>
    <head>
        <meta charset="UTF-8">
        <title>用户注册表</title>
        <style>
            .zh{
                text-align:center;
                border-radius:20px;
                width:500px;
                height:500px;
                position:absolute;
                left:50%;
                top:50%;
                transform:translate(-50%,-50%);
                border-style:solid;
                 background-repeat: no-repeat;
            }
            body{
                 width:3010px;
                height:2010px;
                 background-repeat: no-repeat;
                 background-image: url(2.jpg);
               background-size: 100%;
            /*transform: rotate(90deg);*/ 
            }
            .a{
               
                height: 100px;
                
            }
            .b{
               position: absolute;
               transform:translate(400%,50%);
            }
            .c{
                 position: absolute;
                transform:translate(700%,-40%);
            }
        </style>
    </head>
    <body >
        
        <div class="zh">
            <form action="register.php" method="post"
                  enctype="multipart/form-data">
                <h3>用户注册</h3>
                <div>登录账号：<input type="text"  name="username"></div>
                <br/>
                <div>登录密码：<input type="password" name="password"></div>
                <br/>
                <div>确认密码：<input type="password" name="password"></div>
                <br/>
                <div>验证码&nbsp;&nbsp;&nbsp;：<input type="text" name="verifycode" class="captcha"></div>
                <br/>
                <div>
                <img id="captcha_img" src="captcha.php?r=<?php echo rand();?>" alt="验证码">
                <label><a href="javascript:void(0)" rel="external nofollow" onclick="document.getElementById('captcha_img').src='captcha.php?r='+Math.random()">换一个</a> </label>
                </div>
               
                <br/>
                <div class="a" >
                    <div class="b"><input type="submit" value="确定"/></div>
                    <br/>
                    <div class="c"> <input type="reset" value="取消"/></div>
                 </div>
                <?php 

                ?>
            </form>
        </div>
            
    </body>
</html>
